﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace RadarMonitor.Setting
{
   public class Setting
   {
        private static Setting setting = new Setting();
        private RadarMonitorConfig config;
        private Setting()
        {
            try 
            {
                config = ObjectXMLSerializer<RadarMonitorConfig>.Load(RadarMonitorConfig.FileName);
            }
            catch
            {
                config = new RadarMonitorConfig();
            }
        }

        public static RadarMonitorConfig GetConfig() => setting.config;

        public static void Save()
        {
            try {
                ObjectXMLSerializer<RadarMonitorConfig>.Save(setting.config, RadarMonitorConfig.FileName);
            }
            catch { }
        }

             


    }
}
